-
Notifications
You must be signed in to change notification settings - Fork 759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support setting other defaults in the re-usable agent besides cookies. #453
Conversation
Any feedback on this? |
I was trying to use this feature (as documented by Superagent) and was surprised when it didn't work. Given that the current version of Supertest already depends on superagent@^3.8.3, is there any reason this shouldn't be merged? It would simply be matching Superagent's behaviour: Having to write wrapper functions currently to apply defaults is no fun. @markstos Maybe rebasing to remove the conflicts might help ease things along? The dependency version change is no longer required at least. |
Since `superagent` 3.8, there has been support for the re-usable agent supporting other defaults besides cookies. For example, it's particularly useful to set default 'Authorization' header before running repeated tests against an authenticated API. I tracked down which version of `superagent` we needed to use as a minimum dependency to this commit: ladjs/superagent@66aed34 This update should be considered a bug fix, as 'supertest' claims to support all of superagent's features, but this feature is documented in superagent, but wasn't working in `supertest'.
4d9057b
to
7cab097
Compare
I've now re-based this to address conflicts. Feedback is appreciated. |
Pull Request Test Coverage Report for Build 332
💛 - Coveralls |
@mikelax this is the supertest missing feature, any chance to get this in? |
Why not merge this on December 28th, 2018, to celebrate the one year anniversary of the pull request? |
still waiting for this feature ... seems to be already solved, but not merged .... |
Should be fixed by #539 in v4.0 (I have no idea why that PR was merged but this one got no attention) |
Didn't know this was outstanding. Things get missed, looks like there was a transition in maintainers since this PR was opened. |
Same feature has been merged into v4.0.0 🚀 Related PR: #539 (comment) Thank you everybody for your contributions 🙏 |
Since
superagent
3.8, there has been support for the re-usable agentsupporting other defaults besides cookies.
For example, it's particularly useful to set default 'Authorization'
header before running repeated tests against an authenticated API.
I tracked down which version of
superagent
we needed to use as aminimum dependency to this commit:
ladjs/superagent@66aed34
This update should be considered a bug fix, as 'supertest' claims to
support all of superagent's features, but this feature is documented in
superagent, but wasn't working in `supertest'.